#include "Server.h"

extern user_list *list;

int main(int argc, char const *argv[])
{
    if (argc != 2)
    {
        printf("输入的格式错误 %s port\n",argv[0]);
        exit(1);
    }
    
    pthread_t tid = 0;
    int sock_client;

    tcp_server_init(atoi(argv[1]));


    list = Init_Sql_List();

    while (1)
    {
        sock_client = tcp_server_listen();

        pthread_create(&tid ,NULL ,pthread_server , (void *)&sock_client);

        pthread_detach(tid);
    }
    

    tcp_server_close();

    return 0;
}
